<template>
  <wl-list class="wl-content-container" :listData="myState" @pageChange="pageChange" @sizeChange="sizeChange">
      <wl-query slot="query" @doQuery="doQuery">
      <template slot="main">
          <el-form :model="mainData" class="form-query"  label-width="90px" >
            <wl-form-item :importance="false" label="网站名称" prop="website_name"   :itemData="mainData">
                <wl-input slot="input" slot-scope="col" class="wl-input-item" :rawData="col.columnData" field="website_name" placeholder="请输入网站名称"></wl-input>
            </wl-form-item>
            <wl-form-item :importance="false" label="申请人" prop="apply_account"   :itemData="mainData">
                <wl-arr-select reqUrl="/account/list.do" :isMore="false" slot="input" slot-scope="col" type="apply_account"  :rawData="col.columnData"></wl-arr-select>
            </wl-form-item>
            <wl-form-item :importance="false"  label="工作流状态" prop="audit_status" :itemData="mainData">
              <wl-select slot="input" slot-scope="col" type="audit_status" :isNoShow="true" :code="feature_code" :rawData="col.columnData"></wl-select>
            </wl-form-item>
          </el-form>
      </template>
      <template slot="adv">
          <el-form  class="form-query" :model="advData"  label-width="80px" >
            <wl-form-item :importance="false"  label="域名网址" prop="website_url" :itemData="advData">
              <wl-input slot="input" slot-scope="col" class="wl-input-item" :rawData="col.columnData" field="website_url" placeholder="请输入域名网址"></wl-input>
            </wl-form-item>
            <wl-form-item :importance="false" label="日期" prop="date" :itemData="advData">
                <el-date-picker
                  v-model="advData.date"
                  slot="input" slot-scope="col"
                  :unlink-panels="true"
                  value-format ="yyyy-MM-dd HH:mm:ss"
                  :default-time="['00:00:00', '23:59:59']"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期">
                </el-date-picker>
            </wl-form-item>
          </el-form>
      </template>
    </wl-query>
    <wl-container slot="operator" align="right">
      <wl-tip-button icon="btn_sh"  btnType="" :isNormal="true"  :disabled="!isAudit" tips="审核流程流转到本账号才可审核"  tipsDisabled @click="doAudit" label="审核"></wl-tip-button>
    </wl-container>
    <el-table  slot="table" ref="auditMTable" :row-class-name="rowClassName" :data="myState.data_list" style="width: 100%" border stripe
     @selection-change="handleSelectionChange" @expand-change="expandChange" @row-click="rowClick" class="auditMTable"	>
      <el-table-column type="selection" width="40"></el-table-column>
      <el-table-column  type="expand">
       <template slot-scope="props">
        <el-form label-position="left" inline class="demo-table-expand">
          <el-form-item label="发起人">
            <span>{{ props.row.apply_account }}</span>
          </el-form-item>
          <el-form-item label="发起日期">
            <span>{{ props.row.create_time }}</span>
          </el-form-item>
          <el-form-item label="工作流状态">
            <span>{{ props.row.audit_status}}</span>
          </el-form-item>
          <el-form-item label="上一审核人">
            <span>{{ props.row.lastRole }}</span>
          </el-form-item>
          <el-form-item label="审核日期">
            <span>{{ props.row.auditDate }}</span>
          </el-form-item>
          <el-form-item label="当前审核人">
            <span>{{ props.row.nowRole}}</span>
          </el-form-item>
        </el-form>
      </template>
      </el-table-column>
      <el-table-column label="操作" width="120" class-name="operation_cell">
        <template slot-scope="scope">
          <wl-tip-button icon="btn_sh"  tips="审核" @click="rowSet(scope.$index, scope.row)"></wl-tip-button>
          <wl-tip-button icon="btn_xq"  tips="查看" @click="rowEdit(scope.$index, scope.row)"></wl-tip-button>
        </template>
      </el-table-column>
      <el-table-column prop="status" label="工作流状态">
        <template slot-scope="scope">
         <wl-status type="audit_status" :label="scope.row.status"></wl-status>
        </template>
      </el-table-column>
      <el-table-column prop="url" label="域名网址"></el-table-column>
      <el-table-column prop="name" label="网站名称"></el-table-column>
      <el-table-column prop="apply_account" label="申请人"></el-table-column>
    </el-table>
  </wl-list>
</template>
<script lang="ts" src="./audit_manage.ts"></script>
